import { Path, Point } from '@antv/x6';
import { NODE_HEIGHT } from "../constant";
export default function connector(sourcePoint, targetPoint, routePoints, args) {
  var path;
  var _args$side = args.side,
    side = _args$side === void 0 ? 'left' : _args$side,
    _args$height = args.height,
    height = _args$height === void 0 ? NODE_HEIGHT : _args$height;
  var radius = height / 2;
  if (side === 'right') {
    var prev = Point.create(sourcePoint.x + radius, sourcePoint.y - radius);
    path = new Path(Path.createSegment('M', prev));
    path.arcTo(12, 12, 0, 1, 1, targetPoint.x + radius, targetPoint.y + radius);
  } else {
    var _prev = Point.create(sourcePoint.x - radius, sourcePoint.y - radius);
    path = new Path(Path.createSegment('M', _prev));
    path.arcTo(12, 12, 0, 1, 1, targetPoint.x - radius, targetPoint.y + radius);
  }
  return path.serialize();
}